<?php
/**
 * DBShop 电子商务系统
 *
 * ==========================================================================
 * @link      http://www.dbshop.net/
 * @copyright Copyright (c) 2012-2015 DBShop.net Inc. (http://www.dbshop.net)
 * @license   http://www.dbshop.net/license.html License
 * ==========================================================================
 *
 * @author    静静的风
 *
 */

namespace Paper\Model;

class Paper
{
    private static $dataArray = array();
    
    private static function checkData ($data)
    {
        self::$dataArray['id']                  = (isset($data['id'])             and !empty($data['id']))              ? intval($data['id'])           : null;
        self::$dataArray['delivery_time']       = (isset($data['delivery_time'])  and !empty($data['delivery_time']))   ? trim($data['delivery_time'])  : null;
        self::$dataArray['line_spacing']        = (isset($data['line_spacing'])   and !empty($data['line_spacing']))    ? intval($data['line_spacing']) : null;
        self::$dataArray['pages']               = (isset($data['pages'])          and !empty($data['pages']))           ? trim($data['pages'])          : null;
        self::$dataArray['price']               = (isset($data['price'])          and !empty($data['price']))           ? trim($data['price'])          : null;
        self::$dataArray['status']              = (isset($data['status'])         and !empty($data['status']))          ? trim($data['status'])         : null;
        self::$dataArray['ratio']               = (isset($data['ratio'])          and !empty($data['ratio']))           ? trim($data['ratio'])          : null;
		self::$dataArray['time']                = (isset($data['time'])           and !empty($data['time']))            ? trim($data['time'])          : null;
    
        self::$dataArray = array_filter(self::$dataArray);
    
    
        return self::$dataArray;
    }
    /**
     * 添加Paper过滤
     * @param array $data
     * @return array
     */
    public static function addPaperData (array $data)
    {
        return self::checkData($data);
    }
}